<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>高阶函数</title>
  </head>
  <body>
    <script>
      // 高阶函数：函数作为参数传递
      function fun(a, b, callback) {
        console.log(a + b);
        callback && callback();
      }
      fun(1, 2, function () {
        console.log('我是最后调用的');
      });
    </script>
  </body>
</html>
